﻿//
//
// 版权所有 (c) 2021-2023 JR  
//
// 特此免费授予获得本软件的任何人以处理本软件的权利，但须遵守以下条件：在所有副本或重要部分的软件中必须包括上述版权声明和本许可声明。
//
// 软件按“原样”提供，不提供任何形式的明示或暗示的保证，包括但不限于对适销性、适用性和非侵权的保证。
// 在任何情况下，作者或版权持有人均不对任何索赔、损害或其他责任负责，无论是因合同、侵权或其他方式引起的，与软件或其使用或其他交易有关。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EMC.VISITOR.Core;
[SugarTable("SysHDetail", "工作日节假日排版")]
[SysTable]
public class SysHolidayDetail : EntityBase
{
    [SugarColumn(IsNullable = false, ColumnDescription = "标题")]
    public string title { get; set; }
    [SugarColumn(IsNullable = false, ColumnDescription = "年")]
    public int year { get; set; }
    [SugarColumn(IsNullable = false, ColumnDescription = "月")]
    public int month { get; set; }
    [SugarColumn(IsNullable = false, ColumnDescription = "日")]
    public int day { get; set; }
    [SugarColumn(IsNullable = false, ColumnDescription = "年月日")]
    public DateTime date { get; set; }
    [SugarColumn(IsNullable = false, ColumnDescription = "工作天数")]
    public int value { get; set; }
    /// <summary>
    /// 工作时长
    /// </summary>
    [SugarColumn(IsNullable = false, ColumnDescription = "工作时长")]
    public decimal time { get; set; }
    /// <summary>
    /// 工作、休息/开始时间
    /// </summary>
    [SugarColumn(IsNullable = true, ColumnDescription = "工作、休息/开始时间")]
    public DateTime? start { get; set; }
    /// <summary>
    /// 工作、休息/结束时间
    /// </summary>
    [SugarColumn(IsNullable = true, ColumnDescription = "工作、休息/结束时间")]
    public DateTime? end { get; set; }

    [SugarColumn(IsNullable = false, ColumnDescription = "状态")]
    public HolidayDetailStatus status { get; set; }
    /// <summary>
    /// 允许拖动缩放
    /// </summary>
    [SugarColumn(IsNullable = false, ColumnDescription = "允许拖动缩放")]
    public bool editable { get; set; }=false;
    /// <summary>
    /// 允许时间重叠，即可以与其他事件并存
    /// </summary>
    [SugarColumn(IsNullable = false, ColumnDescription = "允许时间重叠，即可以与其他事件并存")]
    public bool overlap { get; set; }=false;
    public virtual SysHolidayDetail Clone()
    {
        //MemberwiseClone：返回当前对象的浅表副本(它是Object对象的基方法)
        return (SysHolidayDetail)this.MemberwiseClone();
    }
}
[Description("工作日状态")]
public enum HolidayDetailStatus
{
    [Description("工作")]
    working = 0,
    [Description("休息")]
    rest = 1,
}
